package com.hbue.springboot.mapper;

import com.baomidou.mybatisplus.core.mapper.BaseMapper;
import com.hbue.springboot.pojo.TbWorker;
import com.hbue.springboot.pojo.TbWorker;
import org.apache.ibatis.annotations.Mapper;
import org.apache.ibatis.annotations.Param;
import org.apache.ibatis.annotations.Select;
import org.apache.ibatis.annotations.Update;

import java.util.List;

@Mapper
public interface ManageWorkerMapper extends BaseMapper<TbWorker> {
    @Select("SELECT * FROM tb_worker WHERE worker_name LIKE CONCAT('%', #{workerName}, '%') and deleted = 0")
    List<TbWorker> getWorkerByName(@Param("workerName") String workerName);

    @Update("update tb_worker set worker_salary = #{money} where id = #{id}")
    int updateWorkerSalaryById(@Param("money") int money, @Param("id") int id);
}
